//
//  ILGLiveTool.h
//  IfengLiveRecord
//
//  Created by zhangtongle-Pro on 2017/9/8.
//  Copyright © 2017年 凤凰新媒体. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <AVFoundation/AVCaptureDevice.h>

typedef NS_ENUM(int, ILGStreamState) {
    ILGStreamStateIdle, //空闲
    ILGStreamStateConnecting, //连接中
    ILGStreamStateConnectSuccess, //连接成功
    ILGStreamStateDisconnecting, //断开连接中
    ILGStreamStateConnectFailure, //连接失败
    ILGStreamStateSendDataTimeout, //推流超时
    ILGStreamStateBadNetwork //网络不好，建议中断推流
    
};

// 推流状态变化通知
@protocol ILGLiveToolDelegate <NSObject>

- (void)ILGStreamStateChanged:(ILGStreamState)state;

@end

@interface ILGLiveTool : NSObject
@property (nonatomic, weak) id<ILGLiveToolDelegate>delegate;
@property (nonatomic, assign, readonly) CGFloat beautyValue;
@property (nonatomic, assign, readonly) AVCaptureDevicePosition cameraPosition;

/**
 开始直播预览
 
 @param view 视频预览父视图
 */
- (void)startPreview:(UIView *)view;
- (void)startPreview:(UIView *)view inDirection:(UIInterfaceOrientation)direction;
/**
 停止直播预览
 */
- (void)stopPreview;

/**
 开始推流
 
 @param urlString 推流地址
 */
- (void)startPush:(NSString *)urlString;
/**
 暂停推流
 */
- (void)pausePush;
/**
 停止推流
 */
- (void)stopPush;

/**
 翻转摄像头
 */
- (void)switchCamera;

/**
 调整美颜效果
 
 @param value 美颜程度, 1~10
 */
- (void)adjustBeautyValue:(CGFloat)value;

/**
 视频上传码率

 @return 视频码率
 */
- (double)videoUploadBitrate;

/**
 设置耳返

 @param isOpen YES:打开；否则关闭
 */
- (void)setBGMEarsBack:(BOOL)isOpen;
@end
